#include<bits/stdc++.h>
using namespace std;
#define int long long

int n, w;
int c[100];
bool vis[100];
int ans = INT_MAX;

int used[100];

void dfs(int k, int cnt) {
	if (cnt >= ans)
		return ;

	if (k == n + 1) {
		if (ans > cnt)
			ans = cnt;
		return ;
	}

	for (int i = 1; i <= n; i++) {
		if (!used[i]) {
			used[i] += c[k];
			dfs(k + 1, cnt);
			used[i] -= c[k];
			break;
		} else if (used[i] + c[k] <= w) {
			used[i] += c[k];
			dfs(k + 1, cnt);
			used[i] -= c[k];
		}
	}
}

signed main() {
	cin >> n >> w;
	for (int i = 1; i <= n; i++)
		cin >> c[i];
	sort(c + 1, c + n + 1, less<int>());
	dfs(1, 1);
	cout << ans;
	return 0;
}
